<template>
	<view class="flex_ZC">
		<view class="back flex_c">
			<image class="backimg" :src="baseUrl + '/static/icon/left_jt.png'" mode="aspectFill" @click="goBack">
			</image>
			<image class="shareimg" @click="shareflag=true"
				src="https://images.fudiemall.com/storage/default/20250423/shares5b7dae1773abdb5ee869f584b69936ca0a435c78.png"
				mode="aspectFill"></image>
		</view>
		<view class="swipers">
			<u-swiper :list="goodsInfo.images" indicator indicatorMode="dot" circular bgColor="transparent"
				height="375">
			</u-swiper>
		</view>
		<view class="goods flex_Z">
			<view class="goods_top">
				<text class="f24 c4">￥</text>
				<text class="f48 c4 fw7 marr6">{{goodsInfo.min_price}}</text>
				<text class="f24 c9 delect">￥{{goodsInfo.min_origin_price}}</text>
				<text class="f24 c0  gradient1 integral marl14"
					v-if="goodsInfo.is_not_sale == 0">+{{goodsInfo.integral_proportion}}%More值</text>
			</view>
			<text class="f34 c3 overflow2">{{goodsInfo.name}}</text>
			
			<scroll-view class="small" scroll-x="true" :show-scrollbar="false">
				<view class="small_box flex_dq">
					<text class="labels" v-for="(item,index) in goodsService" :key="index"
						@click="showCenter(index)">{{item.name}}</text>
				</view>
			</scroll-view>
			
			
			<view class="mart14 flex_ld">
				<text class="f24 c9">已抢{{goodsInfo.total_sales}}件</text>
				<text class="f24 c9">库存{{goodsInfo.total_stock}}件</text>
			</view>
		</view>

		<view class="goods pt24 flex_dq">
			<view class="flex_dq">
				<image :src="sellerInfo.logo" class="images" mode="aspectFill"></image>
				<view class="flex_Z shopInfo">
					<view>

						<text class="sign" v-if="company_type">{{company_type}}</text>
						<text class="goods_shop">{{sellerInfo.name}}</text>
					</view>
					<u-rate readonly size="20" v-model="sellerInfo.evaluate_rate" allowHalf active-color="#FFC300"></u-rate>
<!-- 					<view class=" flex_dq">
						<image class="level_img1" :src="levelimg" mode="widthFix"></image>
						<view class="flex_dq" v-for="(item,index) in levelList" :key="index">
							<image class="level_img2" :src="item" mode="aspectFill"></image>
						</view>
					</view> -->
					<view class="goods_prove">
						<view class="" v-if="sellerInfo.earnest_money_total!=0.00">
							<image :src="baseUrl +'/static/ymimage/yjbzj.png'" mode="aspectFill"></image> 已缴纳保证金
						</view>
						<view v-if="sellerInfo.verify_status == 3">
							<image :src="baseUrl +'/static/ymimage/zzsh.png'" mode="aspectFill"></image>资质已审核
						</view>
					</view>
				</view>
			</view>
			<view class="enterStore f28 c3" @click="goShopDetails">
				进店
			</view>
		</view>
		<view class="shoptuijian">
			<view class="flex_ld">
				<text class="c3 f32 fw5">店铺推荐</text>
				<view class="flex_dq">
					<text class="f24 c9" @click="goShopDetails">查看全部</text>
					<u-icon name="arrow-right" color="#999999" size="13"></u-icon>
				</view>

			</view>
			<view class="tuijiangoods">
				<view class="tuijian_item" style="width: 202rpx;" v-for="(item,index) in storeGoodsList" :key="index"
					@click="goDetails(item.id)">
					<image :src="item.thumb" mode="aspectFill"></image>
					<view class="">
						<view class="tuijian_item_name f24 c3">{{item.name}}</view>
						<view class="c4">
							<text class="f24">￥</text>
							<text class="f30">{{item.min_price}}</text>
						</view>
					</view>
				</view>
			</view>
		</view>
		<view class="goods_detail">
			<view class="goods_txt flex_ld">
				<view class="miaos flex_dq">
					<text v-for="(item,index) in listAc" :key="index" :class="index == inx ?'active':''"
						@click="clickQie(index)">{{item}}</text>
				</view>
				<view class=" flex_dq" v-if="inx == 1" @click="goReviews">
					<text class="f24 c9">查看全部</text>
					<u-icon name="arrow-right" color="#999999" size="13"></u-icon>
				</view>
			</view>

			<view class="describe_btm flex_ZC" v-if="inx == 0">
				<view class="">
					<image class="goods_image" v-for="(item,index) in goodsInfo.detail_images" :key="index" :src="item"
						mode="widthFix"></image>
				</view>
			</view>

			<view v-if="inx == 1">
				<view v-if="evaluateInfo.length>0">
					<view class="evaluate flex_Z" v-for="(item1,index) in evaluateInfo" :key="index">
						<view class=" flex_ld">
							<view class="evaluate_top flex_dq">
								<image :src="item1.user_avatar" mode="aspectFill"></image>
								<text class="f26 c3">{{item1.user_name}}</text>
							</view>
							<view class="score">
								<u-rate activeColor="#FFC300" readonly v-model="item1.score"></u-rate>
							</view>
						</view>
						<view class="mart14">
							<text class="f24 c3 overflow2">{{item1.content}}</text>
							<view v-if="item1.images.length>0">
								<view class="contents_img flex_dq">
									<image v-for="(item2,index2) in item1.images" :key="index2" :src="item2.img"
										mode="aspectFill" @click="previewImg(item1.images)"></image>
								</view>
							</view>
						</view>
					</view>
				</view>
				<view class="flex_dq" v-else>
					<text class="f28 c9">暂无评论~</text>
				</view>
			</view>
		</view>
		<view class="empty6"></view>

		<view class="goods_btm flex_dq" v-if="goodsInfo.is_not_sale == 0">
			<view class="goods_btm_l flex_ld_b">
				<!-- #ifdef H5 -->
				<view class="btn_gn flex_ZC" @click="tokefu">
					<image :src="baseUrl +'/static/icon/kefu.png'" mode="aspectFill"></image>
					<text class="f24 c3">客服</text>
				</view>
				<!-- #endif -->
				<!-- #ifdef MP-WEIXIN -->
				<view class="btn_gn flex_ZC" @click="openCustomerService()">
					<image :src="baseUrl +'/static/icon/kefu.png'" mode="aspectFill"></image>
					<text class="f24 c3">客服</text>
				</view>
				<!-- #endif -->
				<!-- #ifdef MP-ALIPAY -->
				<!-- @click="showkf=true" -->
				<view class="btn_gn flex_ZC" @click="tokefu" v-if="sellerInfo.seller_type != 1">
					<image :src="baseUrl +'/static/icon/kefu.png'" mode="aspectFill"></image>
					<text class="f24 c3">客服</text>
				</view>


				<view class="btn_gn flex_ZC" v-else>
					<image :src="baseUrl +'/static/icon/kefu.png'" mode="aspectFill"></image>
					<text class="f24 c3">客服</text>
					<contact-button class="kefu" tnt-inst-id="Fs0_yOao" scene="SCE01350885" />
				</view>
				<!-- #endif -->
				<view class="btn_gn flex_ZC" @click="goShopCart">
					<image :src="baseUrl +'/static/icon/i_gwc.png'" mode="aspectFill"></image>
					<text class="f24 c3">购物车</text>
				</view>
			</view>
			<view class="goods_btm_r flex_dq">
				<text class="btn_an1 c1" @click="joincar">加入购物车</text>
				<text class="btn_an2 c0" @click="clickBuyNow">立即购买</text>
			</view>
		</view>


		<u-popup :show="payShow" mode="bottom" bgColor="#F5F5F5" :safeAreaInsetBottom='safeAreaInsetBottom' round='15'
			@close="payShow = false">
			<view class="payment flex_ZC">
				<view class="roll_box">
					<view class="address pd3024" v-if="addressInfo">
						<view class="address_top flex_dq">
							<text class="f30 c3">{{addressInfo.name}}</text>
							<text class="f30 c3"><u--text mode="phone" :text="addressInfo.phone"></u--text></text>
							<text class="defaults" v-if="addressInfo.is_default">默认</text>
							<text class="company" v-if="addressInfo.tag == 0">家</text>
							<text class="company" v-if="addressInfo.tag == 1">公司</text>
							<text class="company" v-if="addressInfo.tag == 2">学校</text>
						</view>
						<view class="address_detail">
							<text class="f26 c3 overflow2">{{addressInfo.full_location}}{{addressInfo.address}}</text>
						</view>
						<view class="change_address" @click="changeAddress">
							<text>更换地址</text>
						</view>
					</view>

					<view class="address pd2024" v-else>
						<view class="address_top flex_Z" @click="changeAddress">
							<view class=" flex_ld">
								<text class="f30 c3">暂无收货地址</text>
								<u-icon name="arrow-right" color="#999999" size="16"></u-icon>
							</view>
							<view class=" flex_ld">
								<text class="f28 c6">去添加收货地址</text>
							</view>
						</view>
					</view>

					<view class="commodity">
						<view class="commodity_top flex_dq">
							<view class="goodsimg flex_c">
								<image @click.stop="imageShow=true" :src="skuDetail.image" mode="aspectFill"></image>
							</view>
							<view class="goods_r flex_Z">
								<view class=" flex_dq">
									<text class="f36 c4">￥</text>
									<text class="f44 c4 fw6">{{skuDetail.price}}</text>
								</view>
								<view class="mart14">
									<text class="f32 c3 overflow2">{{skuDetail.goods_name}}</text>
								</view>
							</view>
						</view>
						<view>
							<view class="mart28 flex_Z" v-for="(item,index) in specList" :key="index">
								<text class="f30 c3">{{item.name}}</text>
								<view class="mart14 display1">
									<text class="specific" :class="item2.selected==1?'active2':''"
										v-for="(item2,index2) in item.value" :key="index2"
										@click="changeScale(item2,index)">{{item2.name}}</text>
								</view>
							</view>
						</view>
						<view class="number_bpx flex_ld">
							<text class="f30 c3">购买数量</text>
							<u-number-box v-model="numbers" :min="minNumber" inputWidth="24" buttonSize="24"
								bgColor="#ffffff" @overlimit="overlimit" @change="valChange"></u-number-box>
						</view>
					</view>
					<view class="coupon flex_ld" v-if="Number(userMoney) >= 0.01">
						<view class="coupon_l flex_dq">
							<image :src="baseUrl +'/static/icon/i_dk.png'" mode="aspectFill"></image>
							<text class="f30 c3">使用More券抵扣</text>
						</view>
						<view class="coupon_r flex_dq" @click="changeCoupons">
							<!-- <text class="f28 c3">{{userMoney.slice(0,-2)}}</text> -->
							<text v-if="isMoney" class="f28 c3">本单可使用{{dikouMoney}}</text>
							<image v-if="!isMoney" class="checkboxHead" :src="baseUrl +'/static/icon/i_wxz.png'"
								mode="aspectFill">
							</image>
							<image v-else class="checkboxHead" :src="baseUrl +'/static/icon/i_xz.png'"
								mode="aspectFill"></image>
						</view>
					</view>
					<view class="coupon flex_ld" v-if=" Number(userMoney)<0.01">
						<view class="coupon_l flex_dq">
							<image :src="baseUrl +'/static/icon/i_dk.png'" mode="aspectFill"></image>
							<text class="f30 c3">More券余额不足</text>
						</view>
						<view class="coupon_r flex_dq" @click="changeCoupons">
							<text class="f28 c3">{{userMoney}}</text>

						</view>
					</view>
					<!-- #ifdef MP-WEIXIN -->
					<!-- 					<view class="coupon flex_ld">
						<view class="coupon_l flex_dq">
							<image :src="baseUrl +'/static/icon/i_dk.png'" mode="aspectFill"></image>
							<text class="f30 c3">使用More券抵扣</text>
						</view>
						<view class="coupon_r flex_dq" @click="changeCoupons">
							<text class="f28 c3">{{userMoney.slice(0,-2)}}</text>
							<image v-if="!isMoney" class="checkboxHead" :src="baseUrl +'/static/icon/i_wxz.png'" mode="aspectFill">
							</image>
							<image v-else class="checkboxHead" :src="baseUrl +'/static/icon/i_xz.png'" mode="aspectFill"></image>
						</view>
					</view> -->
					<!-- #endif -->

					<view class="coupon mart28 flex_Z" v-if="goodsInfo.is_virtual==0">
						<view class="coupon_l flex_dq">
							<image :src="baseUrl +'/static/icon/greenintegral1.png'" mode="aspectFill"></image>
							<text class="f30 c3">权益生效规则</text>
						</view>
						<view class="xuanze mart28 flex_ld" v-for="(item,index) in ruleList" :key="index"
							@click="changeRule(item.id)">
							<text class="f28 c3">{{item.name}}</text>
							<image v-if="ruleId == item.id" class="checkboxHead" :src="baseUrl +'/static/icon/i_xz.png'"
								mode="aspectFill"></image>
							<image v-else class="checkboxHead" :src="baseUrl +'/static/icon/i_wxz.png'"
								mode="aspectFill"></image>
						</view>
					</view>

					<view class="coupon mart28 flex_ld" v-if="goodsInfo.is_virtual==0">
						<view class="coupon_l flex_dq">
							<text class="f30 c3">运费</text>
						</view>
						<view class="coupon_r flex_ld">
							<text class="f28 c3">+ {{goodsInfo.freight}}</text>
						</view>
					</view>
				</view>

				<view class="zhanwei"></view>
				<view class="settlement flex_ld">
					<view class=" flex_dq">
						<text class="f28 c3">合计：</text>
						<text class="f48 c4 fw5">{{totalPrice}}</text>
					</view>
					<text class="submit" @click="isPlaceOrder">提交订单</text>
				</view>
			</view>
		</u-popup>
		<u-popup :show="cartShow" mode="bottom" zIndex="100075" bgColor="#ffffff"
			:safeAreaInsetBottom='safeAreaInsetBottom' round='15' @close="cartShow = false">
			<view class="cartment flex_ZC">
				<view class="commodity">
					<view class="commodity_top flex_dq">
						<view class="goodsimg flex_c" @click.stop="imageShow=true">
							<image :src="skuDetail.image" mode="aspectFill"></image>
						</view>
						<view class="goods_r flex_Z">
							<view class=" flex_dq">
								<text class="f36 c4">￥</text>
								<text class="f44 c4 fw6">{{skuDetail.price}}</text>
							</view>
							<view class="mart14">
								<text class="f32 c3 overflow2">{{skuDetail.goods_name}}</text>
							</view>
						</view>
					</view>
					<view>
						<view class="mart28 flex_Z" v-for="(item,index) in specList" :key="index">
							<text class="f30 c3">{{item.name}}</text>
							<view class="mart14 display1">
								<text class="specific" :class="item2.selected==1?'active2':''"
									v-for="(item2,index2) in item.value" :key="index2"
									@click="changeScale(item2,index)">{{item2.name}}</text>
							</view>
						</view>
					</view>
					<view class="number_bpx flex_ld">
						<text class="f30 c3">购买数量</text>
						<u-number-box v-model="cartNumber" inputWidth="24" buttonSize="24" bgColor="#ffffff"
							@overlimit="overlimit" @change="valChange"></u-number-box>
					</view>
				</view>

				<view class="empty4"></view>
				<view class="empty4"></view>
				<view class="settlement lint flex_c">
					<text class="cart_btn" @click="cilckAartAdd">确定</text>
				</view>
			</view>
		</u-popup>

		<u-popup :show="tipShow" mode="center" @close="tipShow = false" closeable bgColor="transparent">
			<view class="prompt flex_ZC">
				<text class="f36">提示</text>
				<text class="prompt_tit">尚未设置More交易密码？</text>
				<view class="prompt_ntm flex_ld_a">
					<text @click="tipShow = false">取消</text>
					<text @click="goPayPwd">去设置</text>
				</view>
			</view>
		</u-popup>

		<u-popup :show="tipShow2" mode="center" @close="tipShow2 = false" closeable bgColor="transparent">
			<view class="prompt flex_ZC">
				<text class="f36">提示</text>
				<text class="prompt_tit">此操作仅限实名用户，是否去实名？</text>
				<view class="prompt_ntm flex_ld_a">
					<text @click="tipShow2 = false">取消</text>
					<text @click="goReal">去实名</text>
				</view>
			</view>
		</u-popup>
		<u-popup :show="imageShow" mode="center" bgColor="#000" zIndex="100076" @close="imageShow = false" closeable>
			<view class="imagwrap" @click.stop="imageShow=false">
				<image :src="skuDetail.image" mode="widthFix"></image>
			</view>
		</u-popup>

		<u-popup :show="serviceShow" mode="center" @close="serviceShow = false" closeable bgColor="transparent">
			<view class="prompt flex_ZC">
				<text class="f36"></text>
				<text class="prompt_tit_s">{{goodsService[serviceInx] && goodsService[serviceInx].content}}</text>
				<view class="prompt_ntm flex_ld_a">
					<text@click="serviceShow=false">知道了</text>
				</view>
			</view>
		</u-popup>

		<u-keyboard ref="uKeyboard" dotDisabled mode="number" bgColor="transparent" closeOnClickOverlay :tooltip="false"
			:show="keyboardShow" @close="isClose" @change="changePwd" @backspace="backspace">
			<view class="keyboardss flex_ZC">
				<u-code-input dot space="26" :maxlength="6" v-model="securityPwd"></u-code-input>
			</view>
		</u-keyboard>
		<u-popup :show="shareflag" mode="bottom" @close="shareflag=false" :safeAreaInsetBottom="false" :closeable="true"
			bgColor="transparent" >
			<view class="sharewrap">
				<view class="shareitem" @click="copyCurrentPagePath">
					<image
						src="https://images.fudiemall.com/storage/default/20250423/lianjie05d677a617d5cae918b1e8e456dc3f53231a46c6.png"
						mode="aspectFill"></image>

					<text>复制链接</text>
				</view>
				<view class="shareitem" v-if="!iswxflag"
					@click="hbflag=true,shareflag=false,canvasDraw(goodsInfo,qrcodeimg)">
					<image
						src="https://images.fudiemall.com/storage/default/20250423/fenxianghaibao998f386470e2bc1bae873632b1d6a65088c0d571.png"
						mode="aspectFill"></image>
					<text>分享海报</text>
				</view>
				<view class="shareitem" v-if="iswxflag" @click="shareToWechat">
					<image
						src="https://images.fudiemall.com/storage/default/20250423/wx9be87cb35b101c40f077a2c04ea9deaa8478182c.png"
						mode="aspectFill"></image>
					<text>分享到微信</text>
				</view>
				<view class="shareitem" @click="gosharelist">
					<image
						src="https://images.fudiemall.com/storage/default/20250522/groupchat8347f23f96f5df3c93e9b39b84ec236f0685722e.png"
						mode="aspectFill"></image>
					<text>分享到群聊</text>
				</view>
				<!-- #ifdef MP-ALIPAY -->
				<view class="shareitem">
					<image :src="baseUrl+ '/static/image/shareapliay.png'" mode="aspectFill"></image>
					<text>分享到支付宝</text>
					<button open-type="share" class="sharebtn"></button>
				</view>
				<!-- #endif -->
			</view>
		</u-popup>
		<u-popup :show="hbflag" mode="center" @close="hbflag=false" :closeable="true" bgColor="transparent"
			:closeOnClickOverlay="false">
			<view class="hbwraps">
				<canvas style="width: 690rpx; height: 922rpx;margin: 0 auto;" canvas-id="inviteCanvas"
					id="inviteCanvas"></canvas>
				<view class="btn" @click="save1">
					保存图片
				</view>
			</view>

		</u-popup>
	</view>
</template>

<script>
	// #ifdef   H5
	import wx from 'weixin-js-sdk';
	// #endif

	import {
		cloudDetail,
		cloudBuynow,
		cloudCreate,
		lastOrderAddress,
		trial,
		storeRecommend
	} from "../../api/cloudMall.js"
	import {
		cartAdd
	} from "../../api/shoppingCart.js"
	import {
		myuser
	} from "../../api/user.js"
	import {
		qrcode,
		wxConfig,
		shareMall
	} from "../../api/other.js"
	import {
		envflag
	} from '../../utils/request.js';

	export default {
		data() {
			return {
				baseUrl: this.$imageBaseUrl,
				ids: '',
				inx: 0,
				nodeCentent: '',
				userMoney: '',
				totalPrice: 0,
				dikouMoney: '0.000',
				payPasword: 0,
				userReal: 0,
				numbers: 1, //数量
				cartNumber: 1, //数量
				minNumber: '', //最小数量
				serviceInx: 0,
				tipShow: false, //提示
				tipShow2: false, //实名弹窗
				isMoney: false, //是否选中
				payShow: false, //支付弹窗
				cartShow: false, //购物车弹窗
				safeAreaInsetBottom: false, //底部兼容
				serviceShow: false,
				secreShow: false, //免密
				goodsInfo: {}, //详情
				goodsService: [], //商品服务保障
				sellerInfo: {},
				skuDetail: {}, //选中的sku商品
				addressInfo: {}, //地址
				goodsSku: [], //sku列表
				specList: [], //规格清单
				evaluateInfo: [], //评价
				listAc: ['商品详情', '买家评价'],
				selectindex: 0,
				goods: [],
				showkf: false,
				ruleId: 1, //权益id
				ruleList: [{
						id: 1,
						name: '确认收货7天后自动获得',
						state: 1
					},
					{
						id: 2,
						name: '支付成功立即生效 (仅支持七天无理由换货)',
						state: 0
					},
				],
				keyboardShow: false,
				securityPwd: '',
				shareflag: false,
				hbflag: false,
				iswxflag: false,
				ishaveurl: false,
				qrcodeimg: "",
				fullPath: "",
				zIndexs: '',
				imageShow: false,
				userId: "",
				levelimg: '',
				user: {},
				levelList: [],
				storeGoodsList: []
			}
		},
		onLoad(e) {
	
			// navigation 跳转携带参数或者扫描支付宝小程序自身的分享
			if (e.id) {
				this.ids = e.id
			}
			// 关联二维码携带的参数
			if (uni.getStorageSync("quick_payparam")) {
				this.ids = uni.getStorageSync("quick_payparam")
			}
			// 扫描小程序自身分享的小程序码， 关联二维码携带的邀请码在app.vue中已经保存过了
			if (e.invite_code) {
				uni.setStorageSync('inviteCode', e.invite_code)
				if (uni.getStorageSync("seller_id")) {
					uni.removeStorageSync("seller_id")
				}
			}
			if (!uni.getStorageSync("token")) {
				// 没有登录保存跳转的url和参数，去重新登录
				uni.setStorageSync("quick_pay", `/pagesMy/cloudCat/goodsDetails?id=${this.ids}`)
				
			}
		},
		onShareAppMessage(res) {
			return {
				title: "福叠猫",
				path: "/pagesMy/cloudCat/goodsDetails?id=" + this.ids + "&invite_code=" + this.user.invite_code,
				imageUrl: this.qrcodeimg,
				desc: "福叠猫是本地生活圈的综合消费平台"
			}
		},
		onShow() {
			this.getEnv()
			this.initGoodsdetail()
			setTimeout(() => {
				this.payShow = false
				this.tipShow = false
				if (uni.getStorageSync('replaceAddress')) {
					this.addressInfo = uni.getStorageSync('replaceAddress')
					console.log(11111, this.addressInfo);
					this.payShow = true
				}
				if (uni.getStorageSync('token')) {
					this.userInfo()
					this.initAddress()
					this.getwxconfig()
					this.getqrcode()
				}
			}, 500)

		},
		watch: {
			securityPwd(newValue) {
				console.log(newValue.length);
				if (newValue.length >= 6) {
					this.keyboardShow = false
					this.isBuyNow()
				}
			},
			// 计算总价
			numbers(value) {
				console.log(value);
				this.obtainMoney()
			},
		},
		computed: {
			company_type() {
				let company_type = this.sellerInfo.company_type
				if (company_type == 'sole_proprietorship') {
					return ''
				} else if (company_type == 'ordinary') {
					return ''
				} else if (company_type == 'specialty') {
					return '专营店'
				} else if (company_type == 'exclusive') {
					return '专卖店'
				} else if (company_type == 'flagship') {
					return '旗舰店'
				}
			}
		},
		methods: {
			goDetails(id) {
				console.log(id);
				uni.navigateTo({
					url: '/pagesMy/cloudCat/goodsDetails?id=' + id
				})
			},
			storeRecommend(seller_id) {
				const data = {
					seller_id: seller_id
				}
				storeRecommend(data).then(res => {
					console.log(res, '店铺推荐商品');
					this.storeGoodsList = res.data
				})
			},
			shareMalls() {
				shareMall({
					task_code: "share_mall"
				}).then(res => {

				})
			},
			tokefu() {
				if (this.sellerInfo.user_id != this.userId) {
					if (this.sellerInfo.seller_type == 1) {

						// #ifdef MP-WEIXIN
						this.openCustomerService()
						// #endif

						// #ifdef H5
						window.location.href = "https://work.weixin.qq.com/kfid/kfcc9a6800d61bdb24d"
						// #endif





					} else {
						uni.navigateTo({
							url: '/pageDao/groupchat/singleChat?id=' + this.sellerInfo.user_id
						});
					}
				}
			},
			openCustomerService() {
				// 更严格的微信小程序环境判断
				wx.openCustomerServiceChat({
					extInfo: {
						url: 'https://work.weixin.qq.com/kfid/kfcc9a6800d61bdb24d'
					},
					corpId: 'wwe55ef53e55448648',
					success(res) {
						console.log(res, "dadsd")
					}
				})

			},
			gosharelist() {
				uni.navigateTo({
					url: "/pageDao/groupchat/sharelist?id=" + this.ids + "&type=3"
				})
			},
			shareToWechat() {
				this.shareflag = false
				// 这里可以通过弹窗等方式引导用户点击微信右上角菜单进行分享
				uni.showModal({
					title: '分享提示',
					content: '请点击微信右上角菜单进行分享',
					showCancel: false
				});
				this.shareMalls()
			},
			getEnv() {
				let isfrom;
				// 小程序环境判断
				// #ifdef MP-WEIXIN
				try {
					const systemInfo = uni.getSystemInfoSync();
					console.log(systemInfo)
					if (systemInfo.platform === 'devtools') {
						isfrom = '浏览器开发者工具';
					} else if (systemInfo.app) {
						const app = systemInfo.app.toLowerCase();
						if (app.includes('alipay')) {
							isfrom = '支付宝小程序';
						} else if (app.includes('micromessenger')) {
							isfrom = '微信小程序';
						}
					}
				} catch (error) {
					// 如果 uni.getSystemInfoSync 报错，说明可能不是小程序环境
				}
				// #endif
				// #ifdef H5
				if (!isfrom) {
					const ua = navigator.userAgent.toLowerCase();
					if (ua.match(/Alipay/i)) {
						isfrom = '支付宝浏览器';
					} else if (ua.match(/MicroMessenger/i)) {
						isfrom = '微信内置浏览器';
						this.iswxflag = true
					} else {
						isfrom = '普通浏览器';
					}
				}
				// #endif

				// H5环境判断


				// 跳转逻辑
				if (isfrom === "微信小程序" || isfrom === "微信内置浏览器") {
					// 这里可以添加微信相关的跳转逻辑
				} else {

				}
				return isfrom;
			},
			setShareConfig() {
				// 分享到朋友圈
				let that = this
				wx.updateTimelineShareData({
					title: that.goodsInfo.name,
					link: that.fullPath,
					imgUrl: that.goodsInfo.thumb,

					desc: '福叠猫云猫商品详情', // 分享描述
					success() {

						console.log('分享到朋友圈成功');
					},
					cancel() {
						console.log('取消分享到朋友圈');
					}
				});

				// 分享给好友
				wx.updateAppMessageShareData({
					title: that.goodsInfo.name,
					link: that.fullPath,
					imgUrl: that.goodsInfo.thumb,
					desc: '福叠猫云猫商品详情', // 分享描述

					success() {

						console.log('分享给好友成功');
					},
					cancel() {
						console.log('取消分享给好友');
					}
				});
			},
			getwxconfig() {
				wxConfig({
					id: this.ids,
					type: 1
				}).then(res => {
					wx.config({
						debug: false, // 开启调试模式,调用的所有 api 的返回值会在客户端 alert 出来，若要查看传入的参数，可以在 pc 端打开，参数信息会通过 log 打出，仅在 pc 端时才会打印。
						appId: res.data.appId, // 必填，公众号的唯一标识
						timestamp: res.data.timestamp, // 必填，生成签名的时间戳
						nonceStr: res.data.nonceStr, // 必填，生成签名的随机串
						signature: res.data.signature, // 必填，签名
						jsApiList: ['updateAppMessageShareData',
							'updateTimelineShareData'
						] // 必填，需要使用的 JS 接口列表
					});
					wx.ready(() => {
						this.setShareConfig()
						console.log("准备好了")
					});
				})
			},
			getqrcode() {
				qrcode({
					id: this.ids,
					type: 1
				}).then(res => {
					this.qrcodeimg = res.data
				})
			},
			copyCurrentPagePath() {
				uni.setClipboardData({
					data: this.fullPath,
					success() {
						uni.showToast({
							title: '复制成功',
							icon: 'success'
						});
					},
					fail() {
						uni.showToast({
							title: '复制失败',
							icon: 'none'
						});
					}
				});
				// 复制路径到剪贴板

			},

			saveImageToPhone(imageUrl) {
				// 创建一个新的 Image 对象
				const img = new Image();
				img.crossOrigin = 'anonymous'; // 允许跨域
				img.src = imageUrl;
				console.log(img, "sssss")
				img.onload = () => {
					// 创建一个 canvas 元素
					const canvas = document.createElement('canvas');
					const ctx = canvas.getContext('2d');

					// 设置 canvas 的宽度和高度与图片一致
					canvas.width = img.width;
					canvas.height = img.height;

					// 在 canvas 上绘制图片
					ctx.drawImage(img, 0, 0);

					// 将 canvas 内容转为图片 URL
					const dataURL = canvas.toDataURL('image/png');

					// 创建一个 a 标签
					const a = document.createElement('a');
					a.href = dataURL;
					a.download = 'image.png'; // 设置下载的文件名为 image.png

					// 模拟点击 a 标签，触发下载
					document.body.appendChild(a);
					a.click();
					document.body.removeChild(a);
				};
			},
			save1() {
				var that = this
				console.log(123456);
				uni.canvasToTempFilePath({
					canvasId: 'inviteCanvas',
					success: function(res) {
						// #ifdef H5
						that.saveImageToPhone(res.tempFilePath)
						// #endif
						// #ifdef MP-WEIXIN || MP-ALIPAY
						uni.saveImageToPhotosAlbum({
							filePath: res.tempFilePath,
							success: function() {
								uni.$u.toast("保存成功")
							},
							fail: function() {
								uni.$u.toast("保存失败")
							}
						});
						// #endif



					},
					fail(reg) {
						console.log(reg);
					}
				})
			},
			// getuser() {
			// 	var that = this
			// 	myuser().then(res => {
			// 		that.user = res.data
			// 		console.log(that.user, "sdasdd")
			// 		that.canvasDraw(res.data)
			// 		console.log("走了")
			// 	})
			// },

			async canvasDraw(data, qrcodeimg) {
				var ctx = uni.createCanvasContext('inviteCanvas', this)
				const screenWidth = uni.getSystemInfoSync().windowWidth; // 获取屏幕宽度
				const rpxToPx = screenWidth / 750; // 计算 rpx 转 px 比例
				// 绘制圆角矩形路径（参数：x, y, width, height, 圆角半径）
				ctx.clearRect(0, 0, 690 * rpxToPx, 922 * rpxToPx);
				let avatarUrl = await new Promise((resove, reject) => {
					uni.getImageInfo({
						src: data.thumb ||
							"https://images.fudiemall.com/storage/default/20250422/Q7axiJ420qRjZYfb247de39baf0adba9a88e8a2e57cb4daa2ec7e06.png",
						success: function(image) {
							console.log(image, "获取头像信息")
							resove(image.path)
						}
					});
				})
				let codeUrl = await new Promise((resove, reject) => {
					uni.getImageInfo({
						src: qrcodeimg,
						success: function(image) {
							console.log(image, "获取图片信息")
							resove(image.path)
						}
					});
				})
				const x = 0,
					y = 0,
					width = 690 * rpxToPx,
					height = 922 * rpxToPx,
					radius = 12;
				ctx.arc(x + radius, y + radius, radius, Math.PI, Math.PI * 1.5); // 左上角
				ctx.arc(x + width - radius, y + radius, radius, Math.PI * 1.5, Math.PI * 2); // 右上角
				ctx.arc(x + width - radius, y + height - radius, radius, 0, Math.PI * 0.5); // 右下角
				ctx.arc(x + radius, y + height - radius, radius, Math.PI * 0.5, Math.PI); //左下角
				// 设置填充颜色（支持 HEX、RGB、RGBA）
				ctx.setFillStyle('#ffffff');
				// 填充路径
				ctx.fill();

				const srcX = 32 * rpxToPx, //左上角x坐标
					srcY = 32 * rpxToPx, //左上角y坐标
					srcWidth = 628 * rpxToPx, //图片宽度
					srcHeight = 628 * rpxToPx; //图片高度
				ctx.drawImage(avatarUrl, srcX, srcY, srcWidth, srcHeight)
				ctx.setFillStyle('#E78C4C');
				ctx.setFontSize(48 * rpxToPx)
				const price = "￥" + data.min_price,
					priceX = 32 * rpxToPx, //左上角x坐标
					priceY = 718 * rpxToPx; // 根据 address 高度确定起始 y 坐标
				ctx.fillText(price, priceX, priceY)
				ctx.setFillStyle('#B2B2B2');
				ctx.setFontSize(28 * rpxToPx)
				const priceWidth = ctx.measureText(price).width;
				const spacing = 40 * rpxToPx; // 间距
				const price1 = "￥" + data.min_origin_price,
					price1X = priceWidth + priceX + spacing + 58 * rpxToPx, //左上角x坐标
					price1Y = 718 * rpxToPx; // 根据 address 高度确定起始 y 坐标
				ctx.fillText(price1, price1X, price1Y)
				ctx.setFillStyle('#3d3d3d');
				ctx.setFontSize(34 * rpxToPx)
				const price1Width = ctx.measureText(price1).width;

				// 绘制价格划线
				ctx.beginPath();
				ctx.moveTo(price1X, price1Y - 6); // 调整划线的垂直位置
				ctx.lineTo(price1X + price1Width, price1Y - 6);
				ctx.strokeStyle = '#B2B2B2'; // 划线颜色与文本颜色一致
				ctx.lineWidth = 2; // 划线宽度
				ctx.stroke();

				// 设置新的文本样式
				ctx.setFillStyle('#3d3d3d');
				ctx.setFontSize(34 * rpxToPx);
				const address = data.name,
					addressX = 32 * rpxToPx, //左上角x坐标
					addressY = 778 * rpxToPx; //左上角y坐标

				// 处理 address 换行
				const maxLength = 14;
				const lines = [];
				for (let i = 0; i < address.length; i += maxLength) {
					lines.push(address.slice(i, i + maxLength));
				}
				if (lines.length > 2) {
					lines.length = 2;
					lines[1] = lines[1].slice(0, -3) + '...';
				}

				// 逐行绘制 address
				lines.forEach((line, index) => {
					ctx.fillText(line, addressX, addressY + index * 50 * rpxToPx);
				});
				const addressLastY = addressY + (lines.length - 1) * 50 * rpxToPx;

				ctx.setFillStyle('#666666');
				ctx.setFontSize(24 * rpxToPx)
				const time = "已抢" + data.total_sales + "件",
					timeX = 32 * rpxToPx, //左上角x坐标
					timeY = addressLastY + 30 + 30 * rpxToPx; // 根据 address 高度确定起始 y 坐标
				ctx.fillText(time, timeX, timeY)
				ctx.setFillStyle('#666666');
				ctx.setFontSize(24 * rpxToPx)
				const stock = "库存" + data.total_stock + "件",
					stockX = timeX + 158 * rpxToPx, //左上角x坐标
					stockY = addressLastY + 30 + 30 * rpxToPx; // 根据 address 高度确定起始 y 坐标
				ctx.fillText(stock, stockX, stockY)
				const srcX1 = 520 * rpxToPx,
					srcY1 = 758 * rpxToPx,
					srcWidth1 = 120 * rpxToPx,
					srcHeight1 = 120 * rpxToPx;
				ctx.drawImage(codeUrl, srcX1, srcY1, srcWidth1, srcHeight1)
				ctx.setFillStyle('#333333');
				ctx.setFontSize(24 * rpxToPx)
				const tips = "扫一扫",
					tipsX = 548 * rpxToPx, //左上角x坐标
					tipsY = 908 * rpxToPx; // 根据 address 高度确定起始 y 坐标
				ctx.fillText(tips, tipsX, tipsY)
				// 执行绘制
				setTimeout(() => {
					ctx.draw();
				}, 1000)
			},
			// 详情
			initGoodsdetail() {
				console.log(this.ids, "请求接口");
				let data = {
					id: this.ids
				}
				cloudDetail(data).then(res => {
					console.log('详情', res)
					if (res.code == 1) {
						this.goodsInfo = res.data
						this.sellerInfo = res.data.seller_info
						this.specList = res.data.spec_list
						this.goodsSku = res.data.sku_list
						this.evaluateInfo = res.data.evaluate
						this.numbers = res.data.one_num
						this.minNumber = res.data.one_num
						this.skuDetail = res.data.sku_list[0]
						this.goodsService = res.data.goods_service
						this.levelimg = res.data.seller_info.attach.seller_level.name_image
						this.levelList = res.data.seller_info.attach.seller_level.level_data.image_data
						// this.obtainMoney()
						// 默认选中第一个
						this.specList.forEach((item, index) => {
							item.value.forEach((item2, index2) => {
								if (index2 == 0) {
									item2.selected = 1
								}
							})
						})
						this.storeRecommend(res.data.seller_id)
						// #ifdef H5 
						// this.getwxconfig()
						// #endif


					}
				})
			},
			joincar() {
				if (this.goodsInfo.is_virtual == 1) {
					uni.$u.toast("虚拟产品不能加入购物车")
				} else {
					this.cartShow = true
					this.zIndexs = "10099"
				}
			},
			// 订单试算
			obtainMoney() {
				console.log(this.skuDetail);
				let goods = [{
					sku_id: this.skuDetail.id,
					number: this.numbers,
				}];
				let data = {
					type: '1',
					goods: goods,
					is_money: this.isMoney ? 1 : 0,
					address_id: this.addressInfo.id,
				}
				// console.log(data);
				trial(data).then(res => {
					console.log('获取价格', res)
					if (res.code == 1) {
						this.totalPrice = res.data.pay_price
						this.dikouMoney = res.data.deduction_amount
					}
				})
			},
			// 获取上次用户地址
			initAddress() {
				lastOrderAddress().then(res => {
					console.log('地址', res)
					if (res.code == 1) {
						this.addressInfo = res.data
					}
				})
			},
			// 个人信息
			userInfo() {
				myuser().then(res => {
					console.log('个人信息', res)
					if (res.code == 1) {
						this.user = res.data
						this.userId = res.data.id
						this.userReal = res.data.is_real
						this.userMoney = res.data.money
						this.secreShow = res.data.secret_free
						if (Number(this.userMoney) == 0) {
							this.isMoney = false
						}
						if (envflag) {
							this.fullPath =
								`https://h5.fudiemall.com/#/pagesMy/cloudCat/goodsDetails?id=${this.ids}&invite_code=${res.data.invite_code}`
						} else {
							this.fullPath =
								`https://h5-test.fudiemall.com/#/pagesMy/cloudCat/goodsDetails?id=${this.ids}&invite_code=${res.data.invite_code}`
						}
						this.payPasword = res.data.is_pay_pasword
					}
				})
			},
			// 立即购买
			isBuyNow() {
				let token = uni.getStorageSync('token');
				let goods = [{
					sku_id: this.skuDetail.id,
					number: this.numbers,
				}];
				if (token) {
					let data = {
						type: '1',
						remark: '',
						is_money: this.isMoney ? 1 : 0,
						goods: goods,
						address_id: this.addressInfo.id,
						pay_password: this.securityPwd,
						equity_selected: this.ruleId,
						mask: 1
					}
					console.log(data);
					cloudCreate(data).then(res => {
						console.log('详情', res)
						if (res.code == 1) {
							this.payShow = false
							if (res.data.status == 1) {
								uni.navigateTo({
									url: '/pagesMy/cloudCat/paymentCenter?type=1' + '&id=' + res.data.id +
										'&totalPrice=' + this.totalPrice
								})
								return
							}
						} else {
							// 清空密码
							this.securityPwd = ''
						}
					})
				} else {
					uni.navigateTo({
						url: '/pageLogin/login/login'
					})
				}
			},
			// 购物车添加
			cilckAartAdd() {
				if (uni.getStorageSync('token')) {
					let data = {
						sku_id: this.skuDetail.id,
						number: this.cartNumber,
					}
					cartAdd(data).then(res => {
						console.log('添加', res)
						if (res.code == 1) {
							this.cartShow = false
							uni.$u.toast(res.msg)
						}
					})
				} else {
					uni.navigateTo({
						url: '/pageLogin/login/login'
					})
				}
			},
			// 多规格 单规格计算 取sku里面对应的id
			changeScale(item2, index) {
				this.specList[index].value.forEach((item3) => {
					// console.log(item2);
					item3.selected = 0
				})
				item2.selected = 1

				let temporary = [];
				this.specList.forEach((item, index) => {
					this.specList[index].value.forEach((item2) => {
						// console.log(item2);
						if (item2.selected) {
							temporary.push(item2.name)
						}
					})
				})
				// console.log(temporary);
				let result = temporary.join('@')
				console.log(result, "---------------");
				this.goodsSku.forEach((item) => {
					console.log(item.spec_name, "----------------------")
					if (item.spec_name == result) {

						this.skuDetail = item
						console.log(this.skuDetail, "---------------------");
					}
				})
				this.obtainMoney()
			},
			//获取页面栈的长度
			goBack() {
				const canNavBack = getCurrentPages()
				console.log(canNavBack.length);
				// 判断是否刷新了浏览器，刷新了浏览器，页面栈只有当前一个
				if (canNavBack.length > 1) {
					uni.navigateBack({
						delta: 1
					})
				} else {
					uni.switchTab({
						url: '/pages/index/cloudCatIndex'
					})
				}
			},
			// 立即购买
			clickBuyNow() {
				console.log(this.userRea);
				if (uni.getStorageSync('token')) {
					this.obtainMoney()
					this.payShow = true
				} else {
					uni.navigateTo({
						url: '/pageLogin/login/login'
					})
				}
			},

			// 提交订单
			isPlaceOrder() {
				
				if (this.addressInfo) {
					this.isBuyNow()
				} else {
					uni.$u.toast('请添加收货地址!')
				}
				
				// 后续需要下面重新放开
				// // #ifdef H5
				// if (this.addressInfo) {
					
				// 	this.isBuyNow()
					
				// 	if (this.isMoney) {
				// 		if (this.payPasword) {
				// 			if(this.secreShow){
				// 				this.isBuyNow()
				// 			}else{

				// 				this.keyboardShow = true
				// 				this.payShow = false
				// 			}
				// 		} else {
				// 			this.payShow = false
				// 			this.tipShow = true
				// 		}
				// 		uni.$u.toast('请前往福叠猫微信小程序进行下单购物')
				// 		this.isBuyNow()
				// 	} else {
				// 		this.isBuyNow()
				// 	}

				// } else {
				// 	uni.$u.toast('请添加收货地址!')
				// }
				// // #endif
				
				// // #ifdef MP-WEIXIN || MP-ALIPAY
				// if (this.addressInfo) {
					
				// 	this.isBuyNow()
				// 	if (this.isMoney) {
				// 		if (this.payPasword) {
				// 			if (this.secreShow) {
				// 				this.isBuyNow()
				// 			} else {
				// 				this.keyboardShow = true
				// 				this.payShow = false
				// 			}
				// 		} else {
				// 			this.payShow = false
				// 			this.tipShow = true
				// 		}
				// 	} else {
				// 		this.isBuyNow()
				// 	}
				// } else {
				// 	uni.$u.toast('请添加收货地址!')
				// }
				// // #endif

			},
			// 关闭键盘
			isClose() {
				this.keyboardShow = false
				this.payShow = true
			},
			// 输入密码
			changePwd(val) {
				if (this.securityPwd.length < 6) {
					this.securityPwd += val;
					// console.log(this.securityPwd);
				} else {
					console.log('超出不累计');
				}
			},
			// 退格键被点击
			backspace() {
				// 删除value的最后一个字符（安全版）
				if (this.securityPwd && this.securityPwd.length > 0) {
					this.securityPwd = this.securityPwd.substr(0, this.securityPwd.length - 1);
				}
				console.log('当前密码:', this.securityPwd); // 更清晰的日志
			},
			// 预览图片
			previewImg(res) {
				let imgAll = [];
				res.forEach((item) => {
					imgAll.push(item.img)
				})
				// console.log(imgAll);
				// 预览图片
				uni.previewImage({
					urls: imgAll,
					longPressActions: {
						success: function(data) {
							console.log(data);
						}
					}
				});
			},
			// 步进器
			valChange(e) {
				console.log('当前值为: ' + e.value)
			},
			overlimit() {
				uni.$u.toast('超出范围!')
			},
			// 选用抵扣券 
			changeCoupons() {
				this.isMoney = !this.isMoney
				this.obtainMoney()
			},
			// 选择权益
			changeRule(id) {
				console.log(id);
				this.ruleId = id
			},
			// 详情/评价
			clickQie(index) {
				this.inx = index
			},
			// 去支付密码页面
			goPayPwd() {
				uni.navigateTo({
					url: '/pageUser/myuser/amendsafepassword'
				})
			},
			// 去实名
			goReal() {
				uni.navigateTo({
					url: '/pageUser/myuser/realname'
				})
			},
			// 更换地址
			changeAddress() {
				uni.navigateTo({
					url: '/pageUser/myuser/addresslist?changeState=' + true
				})
			},
			// 查看全部
			goReviews() {
				uni.navigateTo({
					url: '/pagesMy/cloudCat/buyerReviews?id=' + this.ids
				})
			},
			// 去购物车
			goShopCart() {

				uni.navigateTo({
					url: '/pagesMy/cloudCat/shoppingCart'
				})
			},
			goShopDetails() {
				console.log(this.goodsInfo.seller_id)
				console.log('/pagesMy/cloudCat/shopDetails?id=' + this.goodsInfo.seller_id);
				uni.navigateTo({
					url: '/pagesMy/cloudCat/shopDetails?id=' + this.goodsInfo.seller_id
				})
			},
			showCenter(index) {
				console.log(index);
				this.serviceInx = index
				this.serviceShow = true

			}
		},
		// #ifdef MP-ALIPAY  || MP-WEIXIN
		onShareAppMessage() {
			return {
				title: this.goodsInfo.name,
				link: this.fullPath,
				imgUrl: this.goodsInfo.thumb,
				desc: '福叠猫云猫商品详情', // 分享描述.
				path: `pagesMy/cloudCat/goodsDetails?id=${this.ids}&invite_code=${this.user.invite_code}`, // 分享的小程序页面
				bgImgUrl: this.goodsInfo.thumb,
				success(res) {
					console.log('success', res);
				},
				fail(res) {
					console.log('fail', res)
				},
			}
		},
		// #endif

		onUnload() {
			console.log('触发卸载');
			uni.removeStorageSync("replaceAddress")
		},
	}
</script>
<style>
	.btn_gn {
		position: relative;
		margin-right: 10rpx;
	}

	.btn_gn contact-button {
		width: 50rpx;
		height: 60rpx;
		position: absolute;
		left: 0;
		top: 0;
		opacity: 0 !important;
	}
</style>
<style lang="scss" scoped>
	.sharebtn {
		width: 150rpx;
		position: absolute;
		left: 0;
		top: 0;
		opacity: 0 !important;
	}

	.swipers {
		position: relative;
		width: 750rpx;
		z-index: 2;
	}

	.btn {
		width: 690rpx;
		height: 76rpx;
		background: linear-gradient(270deg, #FA2222 2%, #FFC400 98%);
		border-radius: 64rpx 64rpx 64rpx 64rpx;
		text-align: center;
		font-weight: 400;
		font-size: 28rpx;
		color: #FFFFFF;
		line-height: 76rpx;
		margin-top: 30rpx;
	}

	.hbwraps {
		width: 690rpx;
		margin: 0 auto;
		margin-top: 80rpx;
		/* background: #ffffff; */
		height: 800rpx;
	}

	.sj_bg {
		position: absolute;
		top: 0;
		left: 0;
		width: 750rpx;
		height: 386rpx;
		z-index: 2;
	}

	.sharewrap {
		width: 750rpx;
		height: 200rpx;
		background: #F7F7F7;
		display: flex;
		/* flex-wrap: wrap; */
		/* display: flex; */
	}

	.shareitem {
		width: 150rpx;
		margin-top: 50rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
		margin-left: 20rpx;
		position: relative;

	}

	.shareitem>text {
		font-weight: 400;
		font-size: 24rpx;
		color: #333333;
		margin-top: 14rpx;
	}

	.shareitem>image {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 80rpx;
		height: 80rpx;
	}

	.backimg {
		position: absolute;
		top: 50%;
		left: 0;
		transform: translateY(-50%);
		width: 60rpx;
		height: 60rpx;
	}

	.shareimg {
		position: absolute;
		top: 50%;
		right: 40rpx;
		transform: translateY(-50%);
		width: 60rpx;
		height: 60rpx;
	}

	.back {
		position: fixed;
		/* #ifdef MP-WEIXIN */
		top: 150rpx;
		/* #endif */
		/* #ifdef H5 */
		top: 40rpx;
		/* #endif */
		left: 20rpx;
		width: 100%;
		height: 88rpx;
		z-index: 999;
	}



	.goods {
		width: 690rpx;
		background: #ffffff;
		border-radius: 24rpx;
		margin: 24rpx auto;
		padding: 0 24rpx 30rpx;
	}

	.images {
		width: 122rpx;
		height: 122rpx;
		margin-right: 24rpx;
	}

	.integral {
		padding: 4rpx 14rpx;
		border-radius: 10rpx;
	}

	.goods_top {
		margin-top: 24rpx;
		margin-bottom: 18rpx;
	}

	.marr6 {
		margin-right: 6rpx;
	}

	.marl14 {
		margin-left: 14rpx;
	}


	.goods_detail {
		width: 690rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		padding: 0 24rpx 30rpx;
	}

	.goods_txt {
		margin: 30rpx 0;
	}

	.miaos {
		font-size: 32rpx;
		color: #999999;
	}

	.miaos>text {
		margin-right: 30rpx;
	}

	.active {
		font-weight: 500;
		color: #333333 !important;
	}

	.describe_btm {
		width: 650rpx;
		border-radius: 20rpx;
	}

	.goods_image {
		width: 690rpx;
		/* height: 800rpx; */
		display: block;
	}

	.quanyi {
		width: 92%;
		overflow: hidden;
		color: #ffffff;
		font-size: 28rpx;
	}

	.empty6 {
		width: 750rpx;
		height: 120rpx;
	}

	.goods_btm {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 750rpx;
		height: 110rpx;
		background: #FFFFFF;
	}

	.goods_btm_l {
		width: 30%;
	}

	.btn_gn {
		position: relative;
		margin-right: 10rpx;
	}

	.kefu {
		position: absolute;
		top: 0;
		left: 0;
		width: 50rpx;
		height: 60rpx;
	}

	.btn_gn>image {
		width: 36rpx;
		height: 36rpx;
	}

	.goods_btm_r {
		width: 70%;
	}

	.btn_an1 {
		width: 230rpx;
		height: 68rpx;
		line-height: 68rpx;
		text-align: center;
		font-size: 32rpx;
		border-radius: 40rpx;
		border: 1rpx solid #FFC300;
		margin-right: 24rpx;
	}

	.btn_an2 {
		width: 230rpx;
		height: 68rpx;
		line-height: 68rpx;
		text-align: center;
		font-size: 32rpx;
		border-radius: 40rpx;
		background: linear-gradient(90deg, #FA2222 2%, #FFC300 98%);
	}

	.evaluate {
		margin-top: 30rpx;
	}

	.evaluate_top>image {
		width: 52rpx;
		height: 52rpx;
		border-radius: 50%;
		margin-right: 12rpx;
	}

	.score {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		width: 200rpx;
		/* background: pink; */
	}

	.contents_img {
		margin-top: 16rpx;
		display: block;
	}

	.contents_img>image {
		width: 208rpx;
		height: 208rpx;
		display: block;
		border-radius: 12rpx;
	}

	.payment {
		position: relative;
		width: 750rpx;
		background: #F5F5F5;
		max-height: 1400rpx;
		border-radius: 30rpx 30rpx 0rpx 0rpx;
	}

	.roll_box {
		overflow-y: auto;
	}

	.cartment {
		position: relative;
		width: 750rpx;
		background: #ffffff;
		border-radius: 30rpx 30rpx 0rpx 0rpx;
	}

	.address {
		width: 690rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		margin-top: 50rpx;
	}

	.pd3024 {
		padding: 30rpx 24rpx;
	}

	.pd2024 {
		padding: 20rpx 24rpx;
	}

	.address_top>text {
		margin-right: 16rpx;
	}

	.defaults {
		width: 74rpx;
		height: 36rpx;
		text-align: center;
		font-size: 24rpx;
		color: #ffffff;
		background: #FFC300;
		border-radius: 8rpx;
	}

	.company {
		width: 74rpx;
		height: 36rpx;
		text-align: center;
		font-size: 24rpx;
		color: #ffffff;
		background: #65A3FF;
		border-radius: 8rpx;
	}

	.address_detail {
		margin-top: 20rpx;
	}

	.change_address {
		display: flex;
		align-items: center;
		justify-content: flex-end;
		width: 100%;
	}

	.change_address>text {
		width: 162rpx;
		height: 56rpx;
		line-height: 56rpx;
		text-align: center;
		font-size: 26rpx;
		color: #FFC300;
		border-radius: 40rpx;
		border: 1rpx solid #FFC300;
	}

	.commodity {
		width: 690rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		margin: 24rpx 0;
		padding: 24rpx;
	}

	.goodsimg>image {
		width: 180rpx;
		height: 180rpx;
		border-radius: 12rpx;
	}

	.goods_r {
		margin-left: 30rpx;
	}

	.mart14 {
		margin-top: 14rpx;
	}

	.mart28 {
		margin-top: 28rpx;
	}

	.display1 {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
	}

	.specific {
		padding: 4rpx 26rpx;
		border-radius: 40rpx;
		border: 2rpx solid #f0f0f0;
		background: #f0f0f0;
		font-size: 28rpx;
		color: #666666;
		margin-right: 26rpx;
		margin-bottom: 20rpx;
	}

	.active2 {
		border: 2rpx solid #FFC300 !important;
		color: #FFC300 !important;
		background: #ffffff !important;
	}

	.number_bpx {
		padding: 10rpx 0;
	}

	.coupon {
		width: 690rpx;
		background: #FFFFFF;
		border-radius: 24rpx;
		padding: 24rpx 24rpx;
	}

	.coupon_l>image {
		width: 36rpx;
		height: 36rpx;
		margin-right: 18rpx;
	}

	.checkboxHead {
		width: 36rpx;
		height: 36rpx;
		margin-left: 12rpx;
	}

	.zhanwei {
		width: 100%;
		height: 190rpx;
	}

	.settlement {
		position: absolute;
		bottom: 0;
		left: 0;
		width: 750rpx;
		height: 142rpx;
		background: #FFFFFF;
		padding: 0 30rpx;
	}

	.xuanze {
		width: 100%;
	}

	.lint {
		border-top: 1rpx solid #F2F2F2;
	}

	.cart_btn {
		width: 690rpx;
		height: 80rpx;
		line-height: 80rpx;
		text-align: center;
		background: #FFC300;
		font-size: 32rpx;
		color: #ffffff;
		border-radius: 40rpx;
	}

	.submit {
		width: 242rpx;
		height: 80rpx;
		line-height: 80rpx;
		color: #ffffff;
		font-size: 32rpx;
		background: #FFC300;
		text-align: center;
		border-radius: 40rpx;
	}
	.small {
		width: 100%;
		white-space: nowrap;/* 禁止换行 */
		margin-top: 28rpx;
	}
	
	.small_box {
		display: inline-block;
	}

	.labels {
		font-size: 24rpx;
		color: #ffffff;
		background: #FFC300;
		padding: 4rpx 14rpx;
		margin-right: 10rpx;
		border-radius: 10rpx;
		margin-top: 6rpx;
	}

	.prompt {
		width: 600rpx;
		background: #ffffff;
		margin: 0 auto;
		border-radius: 20rpx;
		padding-top: 10rpx;
		padding-bottom: 40rpx;
	}

	.prompt>text {
		margin-top: 40rpx;
	}

	.prompt_tit {
		margin: 0 30rpx;
		font-size: 28rpx;
		color: #666666;
		text-overflow: ellipsis;
		display: -webkit-box;
		-webkit-box-orient: vertical;
		-webkit-line-clamp: 2;
		overflow: hidden;
	}

	.prompt_tit_s {
		margin: 0 30rpx;
		font-size: 28rpx;
		color: #666666;
	}

	.prompt_ntm {
		width: 100%;
		font-size: 30rpx;
		margin-top: 50rpx;
	}

	.prompt_ntm>text:nth-child(1) {
		width: 200rpx;
		height: 72rpx;
		line-height: 72rpx;
		text-align: center;
		border: 1rpx solid #FFC300;
		border-radius: 40rpx;
		color: #FFC300;
	}

	.prompt_ntm>text:nth-child(2) {
		width: 200rpx;
		height: 72rpx;
		line-height: 72rpx;
		text-align: center;
		background: #FFC300;
		border-radius: 40rpx;
		color: #ffffff;
	}

	/deep/.u-number-box__minus {
		width: 24px !important;
		height: 24rpx;
		border: 1rpx solid #999999;
		border-radius: 8rpx !important;

	}

	/deep/.u-number-box__plus {
		width: 24px !important;
		border: 1rpx solid #999999;
		border-radius: 8rpx !important;
	}


	.keyboardss {
		width: 750rpx;
		padding: 50rpx 0;
		background: #ffffff;
	}

	.goods_prove {
		font-size: 24rpx;
		color: #666666;
		display: flex;
		align-items: center;
	}

	.goods_prove image {
		width: 22rpx;
		height: 24rpx;
		margin-right: 6rpx;
	}

	.goods_prove view {
		margin-right: 18rpx;
		display: flex;
		align-items: center;
	}

	.sign {
		width: 76rpx;
		height: 28rpx;
		background: #FFC300;
		border-radius: 8rpx;
		font-size: 22rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 28rpx;
		margin-right: 16rpx;
	}

	.goods_shop {
		font-weight: 500;
		color: #3D3D3D;
		white-space: nowrap;
		/* 防止文本换行 */
		overflow: hidden;
		/* 隐藏溢出内容 */
		text-overflow: ellipsis;
		/* 显示省略号 */
	}
	.level_img1 {
		width: 116rpx;
		height: 38rpx;
		margin-right: 14rpx;
	}
	
	.level_img2 {
		width: 30rpx;
		height: 30rpx;
	}

	.pt24 {
		padding: 18rpx 20rpx;
		justify-content: space-between;
		margin-top: 0;
	}

	.shopInfo {
		line-height: 46rpx;
	}

	.enterStore {
		width: 126rpx;
		height: 52rpx;
		background: #FFC300;
		border-radius: 86rpx;
		text-align: center;
		line-height: 52rpx;
	}

	.imagwrap {
		width: 100vw;
		height: 100vh;
		display: flex;
		align-items: center;
		justify-content: center;

		>image {
			width: 100%;
		}
	}

	.shoptuijian {
		width: 690rpx;
		background: #ffffff;
		border-radius: 24rpx;
		padding: 24rpx;
		margin: 24rpx auto;

		.tuijiangoods {
			margin-top: 32rpx;
			display: flex;
			flex-wrap: wrap;
			gap: 18rpx;

			.tuijian_item {
				width: 202rpx;

				image {
					width: 202rpx;
					height: 202rpx;
					border-radius: 12rpx;
				}

				.tuijian_item_name {
					width: 202rpx;
					min-height: 68rpx;
					overflow: hidden;
					text-overflow: ellipsis;
					display: -webkit-box;
					-webkit-box-orient: vertical;
					-webkit-line-clamp: 2;
				}

			}
		}
	}
</style>